]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Fix insensitive styling for popup menu items
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 11 Sep 2012 12:00:22 +0000 (14:00 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 13 Sep 2012 21:48:17 +0000 (23:48 +0200)
The selector for insensitive popup menu items was wrong (a PopupMenuItem is
a ShellGenericContainer, not a StButton). Fixing it showed that previous
:insensitive tracking was manual for a reason: we have many items that are
not reactive, but don't want the insensitive styling (for example those in
the battery menu).
Fix it by adding a new style-class, popup-inactive-menu-item, that is added
to all new PopupMenuItems that are not activatable.

https://bugzilla.gnome.org/show_bug.cgi?id=683988

data/theme/gnome-shell.css
js/ui/popupMenu.js
js/ui/status/network.js

index 01536eea97c49798689fcc96d1edae2fcbe2ca5c..a7cfc65931ec70b16541cf4f7ff9b2d5a871ba67 100644 (file)
@@ -195,7 +195,7 @@ StScrollBar StButton#vhandle:active {
     background-color: #4c4c4c;
 }
 
-StButton.popup-menu-item:insensitive {
+.popup-menu-item:insensitive {
     color: #9f9f9f;
 }
 
@@ -234,13 +234,18 @@ StButton.popup-menu-item:insensitive {
     spacing: .5em;
 }
 
-.popup-inactive-menu-item {
+.popup-status-menu-item {
     font-weight: normal;
     color: #999;
 }
 
-.popup-subtitle-menu-item {
+.popup-inactive-menu-item, .popup-inactive-menu-item:insensitive {
+    color: white;
+}
+
+.popup-subtitle-menu-item, .popup-subtitle-menu-item:insensitive {
     font-weight: bold;
+    color: white;
 }
 
 .popup-menu-icon {
index 28be350da7ce9a9e405c8f0cfec0961b6f0d6732..c4b6c4ea6a0465f5c068df1991f783f50e27d7ed 100644 (file)
@@ -61,6 +61,9 @@ const PopupBaseMenuItem = new Lang.Class({
 
         this.setSensitive(this.sensitive);
 
+        if (!this._activatable)
+            this.actor.add_style_class_name('popup-inactive-menu-item');
+
         if (params.style_class)
             this.actor.add_style_class_name(params.style_class);
 
@@ -763,7 +766,7 @@ const PopupSwitchMenuItem = new Lang.Class({
                       { expand: true, span: -1, align: St.Align.END });
 
         this._statusLabel = new St.Label({ text: '',
-                                           style_class: 'popup-inactive-menu-item'
+                                           style_class: 'popup-status-menu-item'
                                          });
         this._statusBin.child = this._switch.actor;
     },
index 89aa63db00fdfdbd5e856270ff1bf77b9c6b698a..4e4e155cebc2b2f7b4dc55ef4fdc95390a28f41a 100644 (file)
@@ -1570,7 +1570,7 @@ const NMApplet = new Lang.Class({
         this._client = NMClient.Client.new();
 
         this._statusSection = new PopupMenu.PopupMenuSection();
-        this._statusItem = new PopupMenu.PopupMenuItem('', { style_class: 'popup-inactive-menu-item', reactive: false });
+        this._statusItem = new PopupMenu.PopupMenuItem('', { reactive: false });
         this._statusSection.addMenuItem(this._statusItem);
         this._statusSection.addAction(_("Enable networking"), Lang.bind(this, function() {
             this._client.networking_enabled = true;